package ExerChapter13Wrapper;

public class StringCommonMethods {
    public static void main(String[] args) {
        // StringBuilder比StringBuffer要快，但是设计多线程要用后者
        StringBuilder  sb = new StringBuilder(10);
        
        sb.append("hello!");

        System.out.println(sb.toString());

        sb.insert(5,",lingyixin");

        System.out.println(sb.toString());

        sb.replace(0, 5, "Hi");

        System.out.println(sb.toString());

        sb.delete(5, 8);

        System.out.println(sb.toString());

        System.out.println(sb.reverse());
// 从左边第一个字符
        System.out.println(sb.indexOf("i"));

        System.out.println(sb.lastIndexOf("i"));

        System.out.println(sb.indexOf("n", 1));

        

        
    }
}
